using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace UM_Model.Models.Mapping
{
    public class UnionistMap : EntityTypeConfiguration<Unionist>
    {
        public UnionistMap()
        {
            // Primary Key
            this.HasKey(t => t.UnionistsID);

            // Properties
            this.Property(t => t.StudentCode)
                .HasMaxLength(7);

            this.Property(t => t.FullName)
                .HasMaxLength(50);

            this.Property(t => t.Derpartment)
                .HasMaxLength(50);

            this.Property(t => t.Class)
                .HasMaxLength(50);

            this.Property(t => t.Gender)
                .HasMaxLength(10);

            this.Property(t => t.Address)
                .HasMaxLength(50);

            this.Property(t => t.Home)
                .HasMaxLength(50);

            this.Property(t => t.Race)
                .HasMaxLength(50);

            this.Property(t => t.PhoneNo)
                .HasMaxLength(11);

            this.Property(t => t.Email)
                .HasMaxLength(50);

            this.Property(t => t.EducationLevel)
                .HasMaxLength(50);

            this.Property(t => t.Religion)
                .HasMaxLength(50);

            this.Property(t => t.Language)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("Unionists");
            this.Property(t => t.UnionistsID).HasColumnName("UnionistsID");
            this.Property(t => t.StudentCode).HasColumnName("StudentCode");
            this.Property(t => t.FullName).HasColumnName("FullName");
            this.Property(t => t.Derpartment).HasColumnName("Derpartment");
            this.Property(t => t.Class).HasColumnName("Class");
            this.Property(t => t.Gender).HasColumnName("Gender");
            this.Property(t => t.Birthday).HasColumnName("Birthday");
            this.Property(t => t.Address).HasColumnName("Address");
            this.Property(t => t.Home).HasColumnName("Home");
            this.Property(t => t.Race).HasColumnName("Race");
            this.Property(t => t.PhoneNo).HasColumnName("PhoneNo");
            this.Property(t => t.Email).HasColumnName("Email");
            this.Property(t => t.EducationLevel).HasColumnName("EducationLevel");
            this.Property(t => t.Religion).HasColumnName("Religion");
            this.Property(t => t.Language).HasColumnName("Language");
            this.Property(t => t.ProcessOfWork).HasColumnName("ProcessOfWork");
            this.Property(t => t.Other).HasColumnName("Other");
            this.Property(t => t.IsEnable).HasColumnName("IsEnable");
        }
    }
}
